package com.pp.wsi;

import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;



@XmlRootElement(name = "users")
public class Users {
	
	
	@XmlElement(name="user")
	private List<User> users=new LinkedList<User>();	
	
	
	
	public void addUser(User u){
		
		for (User user : users) {
			if (u.getUsername().equals(user.getUsername()));
				user = u;
				return;
		}
		
		users.add(u);
	}
	
	public User getUser(String name){
		for(User tmp:users){
			if (tmp.getUsername().equals(name)) 
				return tmp;
		}
		return null;
	}
	

}
